package com.ssish.saas.eccs.mapper;

import com.ssish.saas.eccs.model.EspTxtexpsumm;
import com.ssish.saas.eccs.model.EspTxtexpsummExample;
import com.ssish.saas.eccs.model.EspTxtexpsummKey;
import java.util.List;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.ResultMap;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

public interface EspTxtexpsummMapper {
    int countByExample(EspTxtexpsummExample example);

    int deleteByExample(EspTxtexpsummExample example);

    @Delete({
        "delete from ESP_TXTEXPSUMM",
        "where PAYORCD = #{payorcd,jdbcType=CHAR}",
          "and REFTYP = #{reftyp,jdbcType=VARCHAR}",
          "and REFNO = #{refno,jdbcType=VARCHAR}"
    })
    int deleteByPrimaryKey(EspTxtexpsummKey key);

    @Insert({
        "insert into ESP_TXTEXPSUMM (PAYORCD, REFTYP, ",
        "REFNO, INSBY, INSDT, ",
        "UPDBY, UPDDT, ",
        "EXPSTS, EXPDT, EXPCNT, ",
        "EXPBATCHNO, DWLDT, ",
        "DWLCNT, RESDT, ",
        "RESCNT, REM)",
        "values (#{payorcd,jdbcType=CHAR}, #{reftyp,jdbcType=VARCHAR}, ",
        "#{refno,jdbcType=VARCHAR}, #{insby,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, ",
        "#{updby,jdbcType=VARCHAR}, #{upddt,jdbcType=TIMESTAMP}, ",
        "#{expsts,jdbcType=CHAR}, #{expdt,jdbcType=TIMESTAMP}, #{expcnt,jdbcType=DECIMAL}, ",
        "#{expbatchno,jdbcType=DECIMAL}, #{dwldt,jdbcType=TIMESTAMP}, ",
        "#{dwlcnt,jdbcType=DECIMAL}, #{resdt,jdbcType=TIMESTAMP}, ",
        "#{rescnt,jdbcType=DECIMAL}, #{rem,jdbcType=VARCHAR})"
    })
    int insert(EspTxtexpsumm record);

    int insertSelective(EspTxtexpsumm record);

    List<EspTxtexpsumm> selectByExample(EspTxtexpsummExample example);

    @Select({
        "select",
        "PAYORCD, REFTYP, REFNO, INSBY, INSDT, UPDBY, UPDDT, EXPSTS, EXPDT, EXPCNT, EXPBATCHNO, ",
        "DWLDT, DWLCNT, RESDT, RESCNT, REM",
        "from ESP_TXTEXPSUMM",
        "where PAYORCD = #{payorcd,jdbcType=CHAR}",
          "and REFTYP = #{reftyp,jdbcType=VARCHAR}",
          "and REFNO = #{refno,jdbcType=VARCHAR}"
    })
    @ResultMap("BaseResultMap")
    EspTxtexpsumm selectByPrimaryKey(EspTxtexpsummKey key);

    int updateByExampleSelective(@Param("record") EspTxtexpsumm record, @Param("example") EspTxtexpsummExample example);

    int updateByExample(@Param("record") EspTxtexpsumm record, @Param("example") EspTxtexpsummExample example);

    int updateByPrimaryKeySelective(EspTxtexpsumm record);

    @Update({
        "update ESP_TXTEXPSUMM",
        "set INSBY = #{insby,jdbcType=VARCHAR},",
          "INSDT = #{insdt,jdbcType=TIMESTAMP},",
          "UPDBY = #{updby,jdbcType=VARCHAR},",
          "UPDDT = #{upddt,jdbcType=TIMESTAMP},",
          "EXPSTS = #{expsts,jdbcType=CHAR},",
          "EXPDT = #{expdt,jdbcType=TIMESTAMP},",
          "EXPCNT = #{expcnt,jdbcType=DECIMAL},",
          "EXPBATCHNO = #{expbatchno,jdbcType=DECIMAL},",
          "DWLDT = #{dwldt,jdbcType=TIMESTAMP},",
          "DWLCNT = #{dwlcnt,jdbcType=DECIMAL},",
          "RESDT = #{resdt,jdbcType=TIMESTAMP},",
          "RESCNT = #{rescnt,jdbcType=DECIMAL},",
          "REM = #{rem,jdbcType=VARCHAR}",
        "where PAYORCD = #{payorcd,jdbcType=CHAR}",
          "and REFTYP = #{reftyp,jdbcType=VARCHAR}",
          "and REFNO = #{refno,jdbcType=VARCHAR}"
    })
    int updateByPrimaryKey(EspTxtexpsumm record);
}